package com.addedstuff;

import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
//this spawns a cross or fire
public class Wandoff extends ItemSword {

        public Wandoff(int par1, EnumToolMaterial par2EnumToolMaterial) {
                super(par1,par2EnumToolMaterial);
                this.setCreativeTab(CreativeTabs.tabCombat);
                // TODO Auto-generated constructor stub
        }
    public void registerIcons(IconRegister iconReg)
    {
        itemIcon = iconReg.registerIcon("Brianmodbase:FireWand");
    }
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        MovingObjectPosition Coords = par3EntityPlayer.rayTrace(45, 1);
        if(Coords != null)
        {
                        par2World.setBlock(Coords.blockX, Coords.blockY + 1, Coords.blockZ, Block.fire.blockID);
                        par2World.setBlock(Coords.blockX + 1, Coords.blockY + 1, Coords.blockZ, Block.fire.blockID);
                        par2World.setBlock(Coords.blockX, Coords.blockY + 1, Coords.blockZ - 1, Block.fire.blockID);
                        par2World.setBlock(Coords.blockX - 1, Coords.blockY + 1, Coords.blockZ, Block.fire.blockID);
                        par2World.setBlock(Coords.blockX, Coords.blockY + 1, Coords.blockZ + 1, Block.fire.blockID);
                //TileEntity te = par2World.getBlockTileEntity((int)Coords.blockX, (int)Coords.blockY ,(int) Coords.blockZ);
                        /*
                if (te != null)
                        {
                                te.
                        }
                        */      
        }
        return par1ItemStack;
        
    }
    public int getDamageVsEntity (Entity par1Entity)
	 {
		 return 1000;
	 }
}